class Solution {
public:

    int smallestAbsent(vector<int>& nums) {
        set<int> vis;
        for(int x:nums) {if(x>0) vis.insert(x);}
        int ans=1;
        while(vis.contains(ans)) ans++;
        return ans; 
    }
};